package cn.haocxy.jfm.gui;

import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill;
import javafx.scene.layout.CornerRadii;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import cn.haocxy.jfm.filelist.FileList;

public final class TopArea {

	private final VBox vbox = new VBox();
	
	public TopArea(FileList model) {
		
		MenuBar menu = new MenuBar();
		BackgroundFill fill = new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY);
		Background bg = new Background(fill);
		menu.setBackground(bg);
		
		Menu file = new Menu("文件");
		Menu operation = new Menu("操作");
		Menu help = new Menu("帮助");
		
		menu.getMenus().addAll(file, operation, help);
		
		vbox.getChildren().addAll(new ToolBar(model).toNode());
	}
	
	public Node toNode() {
		return vbox;
	}
}
